{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>
    {# 我暂时不用cdn，因为cdn要联网，我把bookstrap的3.3.7css下载下来放在plugin(插件)中 #}
    <link rel="stylesheet" href="{% static 'plugin/bootstrap/css/bootstrap.min.css' %}">
    {# 使用图标插件 #}
    <link rel="stylesheet" href="{% static 'plugin/font-awesome/css/font-awesome.min.css' %}">
    <style>
        .navbar-default{
            border-radius: 0;
        }
    </style>
    {# 一定要把 css块放在全局css之下，跟下面的js快放在引入jquery之下是一个道理 #}
    {% block css %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url 'index' %}">Tracer</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
{#                <li><a href="#">产品功能</a></li>#}
{#                <li><a href="#">企业方案</a></li>#}
{#                <li><a href="#">帮助文档</a></li>#}
                <li><a href="{% url 'price' %}">价格方案</a></li>

            </ul>

            <ul class="nav navbar-nav navbar-right">
                {% if request.tracer.user %}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">{{ request.tracer.user.username }}<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="{% url 'project_list' %}">管理中心</a></li>
    {#                        <li><a href="#">Another action</a></li>#}
    {#                        <li><a href="#">Something else here</a></li>#}
                            <li role="separator" class="divider"></li>
                            <li><a href="{% url 'logout' %}">退出</a></li>
                        </ul>
                    </li>
                {% else %}
                    <li><a href="{% url 'login' %}">登录</a></li>
                    <li><a href="{% url 'register' %}">注册</a></li>
                {% endif %}
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

{% block content %}{% endblock %}

<script src="{% static 'js/jquery-3.4.1.min.js' %}"></script>
<script src="{% static 'plugin/bootstrap/js/bootstrap.min.js' %}"></script>
{# 一定要把 js块放在引入jquery和bookstrap之下，这样就能让我们写的js使用上jquery和bookstrap的js #}
{% block js %}{% endblock %}
</body>
</html>